/*
Author: Surpass-HC
Source: https://gitee.com/hxchuan000/clpc-1
Mail: surpass-hc@qq.com
*/
#ifndef __QUEUE_OBJECT_OPERATE_H__
#define __QUEUE_OBJECT_OPERATE_H__
#include <queBase.h>
// queue type value operate struct
typedef struct
{
    queOptType objSz; // one object size
    queOptStruct qopt;
} queObjStruct;
// queue type value operate head size
#define queObjHdSz(rdfNbr) (offsetof(queObjStruct, qopt) + queGetHeadSize(rdfNbr))
int queObjInit(void *qotPtr, queOptType qotSize, queOptType objsize, queOptType cfgRdrNbr);
int queObjWrite(void *qotPtr, const void *qotVal);
int queObjRead(void *qotPtr, void *qotVal, uint8_t rdChnl);
// calc queue object buffer total size
#define queObjCalcTotal(number, ojbSize, rdrNbr) (number * ojbSize + queObjHdSz(rdrNbr))
#endif
